/*
 * RequestForm
 * 
 * Version information
 * 
 * Feb 23, 2006
 * 
 * Copyright (c) AmSoft Systems, 2006
 */
package net.amsoft.iservice.isso.webapp.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 * @author rahul
 * 
 */
public class RequestForm extends ActionForm
{

	/**
	 * SAML Authentication Request Document (encoded)
	 */
	private String sSAMLRequest;

	/**
	 * String containing Relay State sent along with SAML Request
	 */
	private String sRelayState;

	public String getRelayState()
	{
		return sRelayState;
	}

	public void setRelayState(String relayState)
	{
		sRelayState = relayState;
	}

	public String getSAMLRequest()
	{
		return sSAMLRequest;
	}

	public void setSAMLRequest(String request)
	{
		sSAMLRequest = request;
	}

	public ActionErrors validate(ActionMapping oActionMapping,
			HttpServletRequest oHttpServletRequest)
	{
		ActionErrors errors = new ActionErrors();

		if (sSAMLRequest == null)
		{
			errors.add("samlRequest", new ActionMessage(
					"error.request.required"));
		}
		
		return errors;
	}
}
